<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>HRM系统</title>
  <link rel="stylesheet" th:href="@{/css/style.css}">
</head>
<body>
<div class="dashboard">
  <header class="header">
    <div class="logo">HRM系统</div>
    <div class="user-info">
      <span th:text="${userInfo.realName}"></span>
      <span class="role-badge" th:text="${userInfo.roleName}"></span>
      <a href="/logout" class="logout-btn">退出</a>
    </div>
  </header>
  <main class="content">
    <h1>欢迎回来，<span th:text="${userInfo.realName}"></span>！</h1>
    <div class="user-details">
      <p><strong>角色：</strong><span th:text="${userInfo.roleName}"></span></p>
      <p><strong>部门：</strong><span th:text="${userInfo.departmentName}"></span></p>
      <p><strong>职位：</strong><span th:text="${userInfo.positionName}"></span></p>
      <div class="module-entries">
        <a th:href="@{/employee/view/{id}(id=${userInfo.userId})}" class="module-btn">我的信息</a>
        <a href="/employee" class="module-btn" th:if="${roleIdValue < 4}">员工信息管理</a>
        <a href="/department" class="module-btn" th:if="${roleIdValue < 3}">组织架构管理</a>
        <a href="/position" class="module-btn" th:if="${roleIdValue < 4}">职位信息管理</a>
        <a href="/contract" class="module-btn">合同信息管理</a>
      </div>
    </div>
  </main>
</div>
</body>
</html>